import request from './request'

// 获取分类列表
export function getCategoryList(params) {
    return request({
        url: '/api/admin/category/list',
        method: 'get',
        params
    })
}

// 获取分类详情
export function getCategoryDetail(id) {
    return request({
        url: `/api/admin/category/${id}`,
        method: 'get'
    })
}

// 添加分类
export function addCategory(data) {
    return request({
        url: '/api/admin/category',
        method: 'post',
        data
    })
}

// 更新分类
export function updateCategory(data) {
    return request({
        url: '/api/admin/category',
        method: 'put',
        data
    })
}

// 删除分类
export function deleteCategory(id) {
    return request({
        url: `/api/admin/category/${id}`,
        method: 'delete'
    })
} 